<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
   
    <body>
        <h:outputLabel value="Duyuru bilgilerini giriniz."/>
        <h:panelGrid style="background-color: white;" columns="2">
            
		<h:outputLabel value="Kişi Ara: "/>
                <p:inputText value="#{SearchBean.text}" >
		<p:ajax event="keyup" update="person"   
                    listener="#{SearchBean.search()}"/>  
		</p:inputText>
		<p:commandButton value="Ara" action="#{SearchBean.search()}" ajax="false"/>
          
            
                <p:panel header="Kişiler">
                    <p:dataTable id="person" var="person" value="#{SearchBean.studentResult}"  selection="#{StudentBean.target}" selectionMode="single" rowKey="#{person.fullName}">
                        <p:column>
                            <h:outputText value="#{person.fullName}" />
                        </p:column> 
                        <p:ajax event="select" update="out" listener="#{StudentBean.selectStudent()}"/>  
                    </p:dataTable>
                </p:panel>
                <h:outputLabel value="Duyuruyu Giriniz"/>
                <p:editor id="inputarea" rows="5" cols="30" value="#{StudentBean.text}"/> 
                <p:commandButton value="Ekle" action="#{StudentBean.addIndependentAnnouncement()}">
                    <f:setPropertyActionListener value="#{person}" target="#{StudentBean.target}"/>
                </p:commandButton>
        </h:panelGrid>
    </body>
</html>
